package behaviorPattern.mediator.SimpleMediatorPattern.v2;

/**
 * @Author: Alex Hu
 * Date: 2020/2/22 6:55 下午
 * Content:
 */


/**
 * 具体同事类
 * @author Alex Hu
 */
public class SimpleConcreteColleague2 implements SimpleColleague {
    SimpleConcreteColleague2() {
        SimpleMediator smd = SimpleMediator.getMedium();
        smd.register(this);
    }

    @Override
    public void receive() {
        System.out.println("具体同事类2：收到请求。");
    }

    @Override
    public void send() {
        SimpleMediator smd = SimpleMediator.getMedium();
        System.out.println("具体同事类2：发出请求...");
        /**请中介者转发*/
        smd.relay(this);
    }
}

